import { Module } from '@nestjs/common';
import { APP_GUARD } from '@nestjs/core';
import { TypeOrmModule } from '@nestjs/typeorm';
import ormconfig from './ormconfig';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { VideoGroupModule } from '@/video-group/video-group.module';
import { UserModule } from '@/user/user.module';
import { AuthModule } from '@/auth/auth.module';
import { FloorModule } from '@/floor/floor.module';
import { JwtAuthGuard } from '@/common/guards/public.guard';


@Module({
    imports: [
        TypeOrmModule.forRoot(ormconfig),
        VideoGroupModule, // 正确添加 VideoGroupModule 到 imports 数组
        UserModule,
        AuthModule,
        FloorModule
    ],
    controllers: [AppController],
    // providers: [AppService],
    providers: [
        {
            provide: APP_GUARD,
            useClass: JwtAuthGuard,
        }
    ],
})
export class AppModule { }